package com.speed_run.sms;

import com.speed_run.utils.Encrypt;

import java.util.ArrayList;

public class SmsDemo {

    public static void main(String[] args) throws Exception {
        int appId = 1400045262;
        String appKey = "b66775c88ccecd3304801ff527418efb";
        String nationCode = "86";
        String phone = "13720541455";
        String msg = "你的验证码是123456";
        String random ="7226249";
        String time = "1513772430";
       /* SmsVoiceVerifyCodeSender sender = new SmsVoiceVerifyCodeSender(appId,appKey);
        try {
            sender.send(nationCode,phone,msg,100,"");
        }catch (Exception e){
            e.printStackTrace();
        }*/

        String param = "appKey="+appKey+"&random="+random+"&time="+time+"&mobile="+phone;
        System.out.println(param);
        String str = Encrypt.getSHA256StrJava(param);
        System.out.println(str);

        SmsSingleSender singleSender = new SmsSingleSender(appId, appKey);
        ArrayList<String> params = new ArrayList<>();
        params.add("1234");
        params.add("12");
        SmsSingleSenderResult singleSenderResult =
                singleSender.sendWithParam("86", phone, 66633, params, "", "", "");
        System.out.println(singleSenderResult.toString());

    }
}
